package com.zf.shuashua.ui.mine;

import android.Manifest;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.DatePicker;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.aliyun.svideo.common.utils.ToastUtils;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.lljjcoder.Interface.OnCityItemClickListener;
import com.lljjcoder.bean.CityBean;
import com.lljjcoder.bean.DistrictBean;
import com.lljjcoder.bean.ProvinceBean;
import com.lljjcoder.style.cityjd.JDCityConfig;
import com.lljjcoder.style.cityjd.JDCityPicker;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.config.PictureMimeType;
import com.luck.picture.lib.entity.LocalMedia;
import com.luck.picture.lib.permissions.PermissionChecker;
import com.luck.picture.lib.style.PictureCropParameterStyle;
import com.luck.picture.lib.style.PictureParameterStyle;
import com.luck.picture.lib.tools.PictureFileUtils;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.interfaces.OnInputConfirmListener;
import com.lxj.xpopup.interfaces.OnSelectListener;
import com.vise.xsnow.http.callback.ACallback;
import com.zf.shuashua.R;
import com.zf.shuashua.api.AbsCallback;
import com.zf.shuashua.api.HttpData;
import com.zf.shuashua.api.Store;
import com.zf.shuashua.base.BaseActivity1;
import com.zf.shuashua.bean.BaseData;
import com.zf.shuashua.bean.EditMe;
import com.zf.shuashua.bean.Me;
import com.zf.shuashua.bean.UpImage;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;

public class EditPersonalActivity extends BaseActivity1 {
    private Toolbar mToolbar;
    private TextView mTvTitle;
    private TextView tvSex;
    private TextView tvName;
    private TextView tvSign;
    private TextView tvBirthday;
    private TextView tvAddr;
    private ImageView imgAvatar;
    private Me.DataBean data;
    //    private BottomDialog dialog;
    private int year;
    private int month;
    private int day;
    private String[] str;
    private PictureParameterStyle mPictureParameterStyle;
    private PictureCropParameterStyle mCropParameterStyle;
    private List<LocalMedia> selectList = new ArrayList<>();
    private int themeId;
    public static final String TAG = "PictureSelector";
    JDCityPicker cityPicker;
    public JDCityConfig.ShowType mWheelType = JDCityConfig.ShowType.PRO_CITY_DIS;
    private JDCityConfig jdCityConfig = new JDCityConfig.Builder().build();

    @Override
    protected void initView() {
        themeId = R.style.picture_WeChat_style;
        getDefaultStyle();
        data = (Me.DataBean) getIntent().getSerializableExtra(com.zf.shuashua.ui.mine.MineFragment.EditPersonal);
        mToolbar = findViewById(R.id.toolbar);
        mTvTitle = findViewById(R.id.tv_title);
        tvSex = findViewById(R.id.tvSex);
        tvName = findViewById(R.id.tvName);
        tvSign = findViewById(R.id.tvSign);
        tvBirthday = findViewById(R.id.tvBirthday);
        tvAddr = findViewById(R.id.tvAddr);
        imgAvatar = findViewById(R.id.imgAvatar);
        initToolBar(mToolbar, true, "");
        mTvTitle.setText("编辑个人资料");
        tvSex.setText(data.getSex());
        Glide.with(this)
                .load(data.getAvatar())
                .placeholder(R.mipmap.ic_avatar_default)
                .apply(RequestOptions.bitmapTransform(new CircleCrop()))
                .diskCacheStrategy(DiskCacheStrategy.ALL)
                .into(imgAvatar);
        tvName.setText(data.getName());
        tvSex.setText(data.getSex() == null ? "" : data.getSex());
        tvAddr.setText(data.getCity() == null ? "" : data.getCity());
        tvBirthday.setText(data.getBirthday() == null ? "" : data.getBirthday());
        tvSign.setText(data.getSignature());
        mWheelType = JDCityConfig.ShowType.PRO_CITY_DIS;
        jdCityConfig.setShowType(mWheelType);

        cityPicker = new JDCityPicker();
        //初始化数据
        cityPicker.init(this);
        //设置JD选择器样式位只显示省份和城市两级
        cityPicker.setConfig(jdCityConfig);
        cityPicker.setOnCityItemClickListener(new OnCityItemClickListener() {
            @Override
            public void onSelected(ProvinceBean province, CityBean city, DistrictBean district) {
                if (province != null && city != null) {
                    HttpData.getInstance().getEditMe("", "", "", "", province.getId(), city.getId(), district.getId(), province.getName() + "-" + city.getName() + "-" + district.getName(), "", new AbsCallback<BaseData<EditMe>>() {
                        @Override
                        public void onRealSuccess(BaseData<EditMe> data) {
                            tvAddr.setText(data.getData().getCity());
                            setResult(RESULT_OK);
                        }

                        @Override
                        public void onFail(int errCode, String errMsg) {
                        }
                    });


                }
            }

            @Override
            public void onCancel() {
            }
        });

        if (data.getBirthday() == null || data.getBirthday().split("-").length < 3) {
            year = 1989;
            month = 12 - 1;
            day = 25;
        } else {
            str = data.getBirthday().split("-");
            year = Integer.parseInt(str[0]);
            month = Integer.parseInt(str[1]) - 1;
            day = Integer.parseInt(str[2]);
        }
        findViewById(R.id.rl_sex).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                new XPopup.Builder(EditPersonalActivity.this)
                        .hasShadowBg(false) // 去掉半透明背景
                        .asBottomList("", new String[]{"男", "女", "取消"},
                                new OnSelectListener() {
                                    @Override
                                    public void onSelect(int position, String text) {
                                        if (position != 2) {
                                            HttpData.getInstance().getEditMe("", text, "", "", "", "", "", "", "", new AbsCallback<BaseData<EditMe>>() {
                                                @Override
                                                public void onRealSuccess(BaseData<EditMe> data) {
                                                    tvSex.setText(data.getData().getSex() + "");
                                                    setResult(RESULT_OK);
                                                }

                                                @Override
                                                public void onFail(int errCode, String errMsg) {

                                                }
                                            });

                                        }
                                    }
                                })
                        .show();
            }
        });

        findViewById(R.id.rl_name).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                new XPopup.Builder(EditPersonalActivity.this)
                        .autoOpenSoftInput(true)
                        .isRequestFocus(false)
                        .hasShadowBg(false) // 去掉半透明背景
                        .asInputConfirm("", "", data.getName(), "1-10中英文字符",
                                new OnInputConfirmListener() {
                                    @Override
                                    public void onConfirm(String text) {
                                        if (text.equals("")) return;
                                        if (text.length() > 10) {
                                            ToastUtils.show(EditPersonalActivity.this, "不能超过10个中英文字符");
                                            return;
                                        }
                                        HttpData.getInstance().getEditMe(text, "", "", "", "", "", "", "", "", new AbsCallback<BaseData<EditMe>>() {

                                            @Override
                                            public void onRealSuccess(BaseData<EditMe> data) {
                                                if (data.isStatus()) {
                                                    tvName.setText(data.getData().getName());
                                                    setResult(RESULT_OK);
                                                } else {
                                                    ToastUtils.show(EditPersonalActivity.this, data.getMessage());
                                                }
                                            }

                                            @Override
                                            public void onFail(int errCode, String errMsg) {

                                            }
                                        });
                                    }
                                })
                        .show();
            }
        });
        findViewById(R.id.rl_sign).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                new XPopup.Builder(EditPersonalActivity.this)
                        .autoOpenSoftInput(true)
                        .hasShadowBg(false) // 去掉半透明背景
                        .isRequestFocus(false)
                        .asInputConfirm("", "", data.getSignature(), "最多30中英文字符",
                                new OnInputConfirmListener() {
                                    @Override
                                    public void onConfirm(String text) {
                                        if (text.equals("")) return;
                                        if (text.length() > 30) {
                                            ToastUtils.show(EditPersonalActivity.this, "不能超过30个中英文字符");
                                            return;
                                        }
                                        HttpData.getInstance().getEditMe("", "", text, "", "", "", "", "", "", new AbsCallback<BaseData<EditMe>>() {


                                            @Override
                                            public void onRealSuccess(BaseData<EditMe> data) {
                                                tvSign.setText(data.getData().getSignature());
                                                setResult(RESULT_OK);
                                            }

                                            @Override
                                            public void onFail(int errCode, String errMsg) {

                                            }
                                        });
                                    }
                                })
                        .show();
            }
        });
        findViewById(R.id.rl_Birthday).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                DatePickerDialog datePickerDialog = new DatePickerDialog(EditPersonalActivity.this, R.style.MyDatePickerDialogTheme, new DatePickerDialog.OnDateSetListener() {
                    @Override
                    public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
                        tvBirthday.setText(year + "-" + (month + 1) + "-" + dayOfMonth);
                        HttpData.getInstance().getEditMe("", "", "", year + "-" + (month + 1) + "-" + dayOfMonth, "", "", "", "", "", new AbsCallback<BaseData<EditMe>>() {

                            @Override
                            public void onRealSuccess(BaseData<EditMe> data) {
                                tvSign.setText(data.getData().getSignature());
                                setResult(RESULT_OK);
                            }

                            @Override
                            public void onFail(int errCode, String errMsg) {

                            }
                        });
                    }
                }, year, month, day);
                datePickerDialog.show();
            }
        });

        findViewById(R.id.rl_addr).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                cityPicker.showCityPicker();
//                dialog = new BottomDialog(EditPersonalActivity.this);
//                dialog.setOnAddressSelectedListener(EditPersonalActivity.this);
//                dialog.setDialogDismisListener(EditPersonalActivity.this);
//                dialog.setTextSize(14);//设置字体的大小
//                dialog.setIndicatorBackgroundColor(android.R.color.holo_orange_light);//设置指示器的颜色
//                dialog.setTextSelectedColor(android.R.color.holo_orange_light);//设置字体获得焦点的颜色
//                dialog.setTextUnSelectedColor(android.R.color.holo_blue_light);//设置字体没有获得焦点的颜色
////              dialog.setDisplaySelectorArea("31",1,"2704",1,"2711",0,"15582",1);//设置已选中的地区
//                dialog.setSelectorAreaPositionListener(EditPersonalActivity.this);
//                dialog.show();
            }
        });


        imgAvatar.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                // 进入相册 以下是例子：不需要的api可以不写
                PictureSelector.create(EditPersonalActivity.this)
                        .openGallery(PictureMimeType.ofImage())// 全部.PictureMimeType.ofAll()、图片.ofImage()、视频.ofVideo()、音频.ofAudio()
                        .loadImageEngine(GlideEngine.createGlideEngine())// 外部传入图片加载引擎，必传项
                        .theme(themeId)// 主题样式设置 具体参考 values/styles   用法：R.style.picture.white.style v2.3.3后 建议使用setPictureStyle()动态方式
                        .isWeChatStyle(true)// 是否开启微信图片选择风格
                        .setPictureStyle(mPictureParameterStyle)// 动态自定义相册主题
                        .setPictureCropStyle(mCropParameterStyle)// 动态自定义裁剪主题
                        .maxSelectNum(1)// 最大图片选择数量
                        .minSelectNum(1)// 最小选择数量
                        .imageSpanCount(4)// 每行显示个数
                        .isOriginalImageControl(false)// 是否显示原图控制按钮，如果设置为true则用户可以自由选择是否使用原图，压缩、裁剪功能将会失效
                        .selectionMode(PictureConfig.SINGLE)// 多选 or 单选
                        .isSingleDirectReturn(true)// 单选模式下是否直接返回，PictureConfig.SINGLE模式下有效
                        .previewImage(true)// 是否可预览图片
                        .isCamera(false)// 是否显示拍照按钮
                        .withAspectRatio(1, 1)// int 裁剪比例 如16:9 3:2 3:4 1:1 可自定义
                        .isZoomAnim(true)// 图片列表点击 缩放效果 默认true
                        .enableCrop(true)// 是否裁剪
                        .compress(true)// 是否压缩
                        .compressQuality(80)// 图片压缩后输出质量 0~ 100
                        .synOrAsy(true)//同步false或异步true 压缩 默认同步
//                        .circleDimmedLayer(true)// 是否圆形裁剪
                        .cutOutQuality(90)// 裁剪输出质量 默认100
                        .minimumCompressSize(100)// 小于100kb的图片不压缩
                        .forResult(PictureConfig.CHOOSE_REQUEST);//结果回调onActivityResult code
            }
        });


        // 清空图片缓存，包括裁剪、压缩后的图片 注意:必须要在上传完成后调用 必须要获取权限
        if (PermissionChecker.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
            //PictureFileUtils.deleteCacheDirFile(this, PictureMimeType.ofImage());
            PictureFileUtils.deleteAllCacheDirFile(this);
        } else {
            PermissionChecker.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
                    PictureConfig.APPLY_STORAGE_PERMISSIONS_CODE);
        }

    }


    private void getDefaultStyle() {
        // 相册主题
        mPictureParameterStyle = new PictureParameterStyle();
        // 是否改变状态栏字体颜色(黑白切换)
        mPictureParameterStyle.isChangeStatusBarFontColor = false;
        // 是否开启右下角已完成(0/9)风格
        mPictureParameterStyle.isOpenCompletedNumStyle = false;
        // 是否开启类似QQ相册带数字选择风格
        mPictureParameterStyle.isOpenCheckNumStyle = true;
        // 状态栏背景色
        mPictureParameterStyle.pictureStatusBarColor = Color.parseColor("#393a3e");
        // 相册列表标题栏背景色
        mPictureParameterStyle.pictureTitleBarBackgroundColor = Color.parseColor("#393a3e");
        // 相册父容器背景色
        mPictureParameterStyle.pictureContainerBackgroundColor = ContextCompat.getColor(this, R.color.app_color_black);
        // 相册列表标题栏右侧上拉箭头
        mPictureParameterStyle.pictureTitleUpResId = R.drawable.picture_icon_wechat_up;
        // 相册列表标题栏右侧下拉箭头
        mPictureParameterStyle.pictureTitleDownResId = R.drawable.picture_icon_wechat_down;
        // 相册文件夹列表选中圆点
        mPictureParameterStyle.pictureFolderCheckedDotStyle = R.drawable.picture_orange_oval;
        // 相册返回箭头
        mPictureParameterStyle.pictureLeftBackIcon = R.drawable.picture_icon_close;
        // 标题栏字体颜色
        mPictureParameterStyle.pictureTitleTextColor = ContextCompat.getColor(this, R.color.picture_color_white);
        // 相册右侧按钮字体颜色  废弃 改用.pictureRightDefaultTextColor和.pictureRightDefaultTextColor
        mPictureParameterStyle.pictureCancelTextColor = ContextCompat.getColor(this, R.color.picture_color_53575e);
        // 相册右侧按钮字体默认颜色
        mPictureParameterStyle.pictureRightDefaultTextColor = ContextCompat.getColor(this, R.color.picture_color_53575e);
        // 相册右侧按可点击字体颜色,只针对isWeChatStyle 为true时有效果
        mPictureParameterStyle.pictureRightSelectedTextColor = ContextCompat.getColor(this, R.color.picture_color_white);
        // 相册右侧按钮背景样式,只针对isWeChatStyle 为true时有效果
        mPictureParameterStyle.pictureRightDefaultBackgroundStyle = R.drawable.picture_send_button_default_bg;
        // 相册右侧按钮可点击背景样式,只针对isWeChatStyle 为true时有效果
        mPictureParameterStyle.pictureRightBackgroundStyle = R.drawable.picture_send_button_bg;
        // 相册列表勾选图片样式
        mPictureParameterStyle.pictureCheckedStyle = R.drawable.picture_wechat_num_selector;
        // 相册标题背景样式 ,只针对isWeChatStyle 为true时有效果
        mPictureParameterStyle.pictureWeChatTitleBackgroundStyle = R.drawable.picture_album_bg;
        // 微信样式 预览右下角样式 ,只针对isWeChatStyle 为true时有效果
        mPictureParameterStyle.pictureWeChatChooseStyle = R.drawable.picture_wechat_select_cb;
        // 相册返回箭头 ,只针对isWeChatStyle 为true时有效果
        mPictureParameterStyle.pictureWeChatLeftBackStyle = R.drawable.picture_icon_back;
        // 相册列表底部背景色
        mPictureParameterStyle.pictureBottomBgColor = ContextCompat.getColor(this, R.color.picture_color_grey);
        // 已选数量圆点背景样式
        mPictureParameterStyle.pictureCheckNumBgStyle = R.drawable.picture_num_oval;
        // 相册列表底下预览文字色值(预览按钮可点击时的色值)
        mPictureParameterStyle.picturePreviewTextColor = ContextCompat.getColor(this, R.color.picture_color_white);
        // 相册列表底下不可预览文字色值(预览按钮不可点击时的色值)
        mPictureParameterStyle.pictureUnPreviewTextColor = ContextCompat.getColor(this, R.color.picture_color_9b);
        // 相册列表已完成色值(已完成 可点击色值)
        mPictureParameterStyle.pictureCompleteTextColor = ContextCompat.getColor(this, R.color.picture_color_fa632d);
        // 相册列表未完成色值(请选择 不可点击色值)
        mPictureParameterStyle.pictureUnCompleteTextColor = ContextCompat.getColor(this, R.color.picture_color_9b);
        // 预览界面底部背景色
        mPictureParameterStyle.picturePreviewBottomBgColor = ContextCompat.getColor(this, R.color.picture_color_half_grey);
        // 外部预览界面删除按钮样式
        mPictureParameterStyle.pictureExternalPreviewDeleteStyle = R.drawable.picture_icon_delete;
        // 原图按钮勾选样式  需设置.isOriginalImageControl(true); 才有效
        mPictureParameterStyle.pictureOriginalControlStyle = R.drawable.picture_original_wechat_checkbox;
        // 原图文字颜色 需设置.isOriginalImageControl(true); 才有效
        mPictureParameterStyle.pictureOriginalFontColor = ContextCompat.getColor(this, R.color.app_color_white);
        // 外部预览界面是否显示删除按钮
        mPictureParameterStyle.pictureExternalPreviewGonePreviewDelete = true;
        // 设置NavBar Color SDK Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP有效
        mPictureParameterStyle.pictureNavBarColor = Color.parseColor("#393a3e");
        // 裁剪主题
        mCropParameterStyle = new PictureCropParameterStyle(
                ContextCompat.getColor(EditPersonalActivity.this, R.color.app_color_grey),
                ContextCompat.getColor(EditPersonalActivity.this, R.color.app_color_grey),
                Color.parseColor("#393a3e"),
                ContextCompat.getColor(EditPersonalActivity.this, R.color.app_color_white),
                mPictureParameterStyle.isChangeStatusBarFontColor);
    }


    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        switch (requestCode) {
            case PictureConfig.APPLY_STORAGE_PERMISSIONS_CODE:
                // 存储权限
                for (int i = 0; i < grantResults.length; i++) {
                    if (grantResults[i] == PackageManager.PERMISSION_GRANTED) {
                        PictureFileUtils.deleteCacheDirFile(EditPersonalActivity.this, PictureMimeType.ofImage());
                    } else {
                        Toast.makeText(EditPersonalActivity.this,
                                getString(R.string.picture_jurisdiction), Toast.LENGTH_SHORT).show();
                    }
                }
                break;
        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == RESULT_OK) {
            switch (requestCode) {
                case PictureConfig.CHOOSE_REQUEST:
                    // 图片选择结果回调
                    selectList = PictureSelector.obtainMultipleResult(data);
                    LocalMedia media = selectList.get(0);
                    if (media == null
                            || TextUtils.isEmpty(media.getPath())) {
                        return;
                    }
                    String path;
                    if (media.isCut() && !media.isCompressed()) {
                        // 裁剪过
                        if (media.isCut()) {
                            Log.i(TAG, "裁剪地址::" + media.getCutPath());
                        }
                        path = media.getCutPath();
                    } else if (media.isCompressed() || (media.isCut() && media.isCompressed())) {
                        // 压缩过,或者裁剪同时压缩过,以最终压缩过图片为准

                        if (media.isCompressed()) {
                            Log.i(TAG, "压缩地址::" + media.getCompressPath());
                            Log.i(TAG, "压缩后文件大小::" + new File(media.getCompressPath()).length() / 1024 + "k");
                        }
                        path = media.getCompressPath();
                    } else {
                        // 原图
                        path = media.getPath();
                        Log.i(TAG, "原图地址::" + media.getPath());
                    }
                    if (!TextUtils.isEmpty(media.getAndroidQToPath())) {
                        Log.i(TAG, "Android Q特有地址::" + media.getAndroidQToPath());
                    }
                    HttpData.getInstance().getUploadImg(new File(path), new ACallback<UpImage>() {
                        @Override
                        public void onSuccess(UpImage data) {
                            if (data.isStatus()) {
                                HttpData.getInstance().getEditMe("", "", "", "", "", "", "", "", data.getData().getUrl(), new AbsCallback<BaseData<EditMe>>() {
                                    @Override
                                    public void onRealSuccess(BaseData<EditMe> data) {
                                        if (data.isStatus()) {
                                            setResult(RESULT_OK);
                                        }
                                    }

                                    @Override
                                    public void onFail(int errCode, String errMsg) {
                                    }
                                });

                            }
                        }

                        @Override
                        public void onFail(int errCode, String errMsg) {
                            Log.i(TAG, errMsg + "");

                        }
                    });

                    Glide.with(EditPersonalActivity.this)
                            .load(path)
                            .centerCrop()
                            .placeholder(R.color.app_color_f6)
                            .diskCacheStrategy(DiskCacheStrategy.ALL)
                            .into(imgAvatar);
                    break;
            }
        }
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_edit_personal;
    }

//    @Override
//    public void dialogclose() {
//        if (dialog != null) {
//            dialog.dismiss();
//        }
//    }
//
//    @Override
//    public void selectorAreaPosition(int provincePosition, int cityPosition, int countyPosition, int streetPosition) {
//
//    }
//    @Override
//    protected void onDestroy() {
//        super.onDestroy();
//        if (dialog != null) {
//            dialog.setOnAddressSelectedListener(null);
//            dialog.setSelectorAreaPositionListener(null);
//        }
//    }
//
//    @Override
//    public void onAddressSelected(Province province, City city, County county, Street street) {
//        String s = (province == null ? "" : province.name) + (city == null ? "" : city.name) + (county == null ? "" : county.name) +
//                (street == null ? "" : street.name);
//        if (dialog != null) {
//            HttpData.getInstance().getEditMe("", "", "", "", s, "", new AbsCallback<BaseData<EditMe>>() {
//
//
//                @Override
//                public void onRealSuccess(BaseData<EditMe> data) {
//                    tvAddr.setText(data.getData().getCity());
//                    setResult(RESULT_OK);
//                    dialog.dismiss();
//                }
//
//                @Override
//                public void onFail(int errCode, String errMsg) {
//                }
//            });
//        }
//    }
}
